/*
 * FileName: 简历简略信息卡片展示组件
 * Created Date: 2022-10-19 10:19:16
 * Author: 文初阳
 * -----
 * Last Modified: 2022-10-19 10:19:16
 * Modified By: 文初阳
 */

import { DeleteOutlined, EditOutlined, EyeOutlined } from '@ant-design/icons';
import { Card } from 'antd';
import React, { useContext, useEffect } from 'react';
import { queryResumeListApi } from '../../../apis/resume';
import { ResumeContext } from '../../../states/resume';
import { IResumeListItem } from '../../../types/resume';

interface IProps {
    data: IResumeListItem;
}
const CardInfo: React.FC<IProps> = ({ data }: IProps) => {
    const { resumeName, name, job, updateTime } = data;
    const { setPageName } = useContext(ResumeContext);
    const handleEditClick = () => setPageName('edit');

    const handlePreviewClick = () => setPageName('preview');

    return (
        <Card
            title={resumeName}
            bordered
            hoverable={true}
            size="small"
            style={{ width: 300 }}
            actions={[
                <EyeOutlined key="preview" onClick={handlePreviewClick} />,
                <EditOutlined key="edit" onClick={handleEditClick} />,
                <DeleteOutlined key="delete" />,
            ]}
        >
            <p>姓名：{name}</p>
            <p>求职岗位：{job}</p>
            <p>最近更新时间：{updateTime}</p>
        </Card>
    );
};

export default CardInfo;
